Skip to content

Conversation

@lrsaturnino
Copy link
Member

Add comprehensive wallet-operator mapping toolset for beta staker consolidation analysis. Enables identification of wallets containing deprecated operators and BTC distribution calculations.

Core functionality:

  • query-dkg-events.js: Extracts operator membership from on-chain DKG events
  • analyze-per-operator.js: Calculates BTC distribution by provider
  • validate-operator-list.js: Verifies operator list completeness

Configuration:

  • operators.json: Defines KEEP (4 active) vs DISABLE (16 deprecated) operators
  • Contract ABIs for Bridge and WalletRegistry interactions
  • Archive node RPC support for historical event queries

Documentation:

  • README: Usage guide and integration points
  • Manual sweep procedures and execution scripts
  • Operator consolidation communication guidelines

Integration:

  • Provides data source for monitoring dashboard
  • Supports draining progress assessment
  • Enables manual sweep decision-making

Technical details:

  • Uses threshold cryptography (51/100 signatures)
  • Queries sortition pool for operator address resolution
  • Classifies operators by provider (STAKED, P2P, BOAR, NUCO)

Add comprehensive wallet-operator mapping toolset for beta staker
consolidation analysis. Enables identification of wallets containing
deprecated operators and BTC distribution calculations.

Core functionality:
- query-dkg-events.js: Extracts operator membership from on-chain DKG events
- analyze-per-operator.js: Calculates BTC distribution by provider
- validate-operator-list.js: Verifies operator list completeness

Configuration:
- operators.json: Defines KEEP (4 active) vs DISABLE (16 deprecated) operators
- Contract ABIs for Bridge and WalletRegistry interactions
- Archive node RPC support for historical event queries

Documentation:
- README: Usage guide and integration points
- Manual sweep procedures and execution scripts
- Operator consolidation communication guidelines

Integration:
- Provides data source for monitoring dashboard
- Supports draining progress assessment
- Enables manual sweep decision-making

Technical details:
- Uses threshold cryptography (51/100 signatures)
- Queries sortition pool for operator address resolution
- Classifies operators by provider (STAKED, P2P, BOAR, NUCO)
const path = require('path');

const MAPPING_FILE = path.join(__dirname, 'wallet-operator-mapping.json');
const CSV_PATH = '/Users/leonardosaturnino/Documents/GitHub/memory-bank/20250809-beta-staker-consolidation/knowledge/threshold_stakers_may_2025.csv';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we commit this file to the repo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit hash 6461451

}

// File paths
const PROOF_OF_FUNDS_PATH = '/Users/leonardosaturnino/Documents/GitHub/memory-bank/20250809-beta-staker-consolidation/knowledge/20251006-tbtc-proof-of-funds.json';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we commit this file to the repo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit hash 6461451

if (providerShares[data.provider]) {
if (data.status === 'KEEP') {
providerShares[data.provider].keep += data.totalShare;
providerShares[data.provider].keepWallets = data.walletCount;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this is = and not +=?

Suggested change
providerShares[data.provider].keepWallets = data.walletCount;
providerShares[data.provider].keepWallets += data.walletCount;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit hash 6461451

providerShares[data.provider].keepWallets = data.walletCount;
} else {
providerShares[data.provider].disable += data.totalShare;
providerShares[data.provider].disableWallets = data.walletCount;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Suggested change
providerShares[data.provider].disableWallets = data.walletCount;
providerShares[data.provider].disableWallets += data.walletCount;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit hash 6461451

Fix critical bugs and configuration issues identified in code review:

Bug Fixes:
- Fix wallet count aggregation in analyze-per-operator.js
  - Changed assignment operator from = to += on lines 122, 125
  - Now correctly sums wallet counts across all operators per provider
  - Previously only recorded last operator's count, causing incorrect analysis

Configuration:
- Externalize hard-coded file paths to environment variables
  - query-dkg-events.js: Use PROOF_OF_FUNDS_PATH with ./data/ fallback
  - validate-operator-list.js: Use THRESHOLD_STAKERS_CSV_PATH with ./data/ fallback
  - Scripts now portable across team members and environments

Documentation:
- Add data file setup section to README.md
- Document two setup options: default directory and env variables
- Create data/README.md with file requirements and sources
- Update .env.example with new configuration variables
- Add data/ directory to .gitignore

All review comments from piotr-roslaniec addressed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants